package com.rx.mgt.dao;

import com.rx.mgt.dao.base.ManagementHibernateDaoBase;
import com.rx.mgt.domain.SysOpreate;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by zxj on 2017/6/1.
 */
@Repository
public class SysOpreateDao extends ManagementHibernateDaoBase<SysOpreate,Long> {

    @Transactional
    public void deleteByDomain(String domain) {
            String  hql = " delete from SysOpreate s where s.domain=:domain";
            Query query = template.getSessionFactory().getCurrentSession().createQuery(hql);
            query.setParameter("domain",domain);
            query.executeUpdate();
        }

}
